<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="css/zhuce.css">
    <!-- <script src="js/zhuce.js"></script> -->
    <script src="js/jquery.js"></script>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>

</head>

<body>
    <div class="header">
        <div class="headlf">
            <img src="imgs/logo.png" alt="">
        </div>
        <div class="headlfr">
            <p>买真酒</p>
            <p>就上酒仙网</p>
        </div>
        <div class="headrt">
            <p>欢迎来到酒仙网！
                <a href="denglu.html">请登录</a>
                <a href="">帮助中心</a>
                <p>


        </div>
    </div>
    <div class="banner">
        <div class="dl">
            <div class="yy">
                <p>手机号</p> <input type="text" class="txt" id=" txt1" placeholder="11位手机号">
                <span class="yz yz1"></span>
            </div>
            <div class="yy ">
                <p>验证码</p> <input type="text " class="txt" id="txt2" placeholder="输入验证码">
                <span class="yz yz2"></span>
            </div>
            <div class="yy">
                <p>校验码</p> <input type="text" class="txt" id=" txt3" placeholder="请输入字母校验码">
                <span class="yz yz3"></span>
            </div>
            <div class="yy ">
                <p class="zz">设置密码</p><input type="password " class="txt" id="txt4" placeholder="请输入密码">
                <span class="yz yz4"></span>
            </div>
            <div class="yy">
                <p class="zz">确认密码</p>
                <input type="password" class="txt" id="txt5" placeholder="请确认密码">
                <span class="yz yz5" id="tishi"></span>
            </div>
            <div class="xy">
                <input type="checkbox" name="" id="">
                <span>我已阅读并同意<a href="">《酒仙用户注册协议》</a><a href="">酒仙网隐私协议</a></span>
                <p>
                    <a href="javascript:;" id="zhc">立即注册</a>
                </p>
            </div>
        </div>
    </div>
    <div class=" footer ">
        <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&copy
            酒仙网 2011 jiuxian.com All Rights Reserved 京ICP证110141号 京公网安备1101050188221</p>
        <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;购买前请确认达到法定饮酒年龄！酒仙网不销售任何含酒精产品给18岁以下人士！</p>
    </div>
    <script>
        var oInput = document.querySelectorAll(".txt")
        var oSpan = document.querySelectorAll(".yz")
        var reg = /^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(18[0,5-9]))\d{8}$/;
        oInput[0].onblur = function() {
            var val1 = oInput[0].value;
            if (reg.test(val1)) {
                oSpan[0].innerText = "格式正确";
            } else {
                oSpan[0].innerText = "格式错误";
            }
        }
        var reg1 = /(?:\d+|[a-zA-Z]+|[!@#$%^&*]+)$/;
        oInput[1].onblur = function() {
            var val2 = oInput[1].value;
            if (reg1.test(val2)) {
                oSpan[1].innerText = "格式正确";
            } else {
                oSpan[1].innerText = "格式错误";
            }
        }
        var reg2 = /^[0-9]{1,20}$/;
        oInput[2].onblur = function() {
            var val3 = oInput[2].value;
            if (reg2.test(val3)) {
                oSpan[2].innerText = "格式正确";
            } else {
                oSpan[2].innerText = "格式错误";
            }
        }
        var reg3 = /^.*(?=.{6,})(?=.*\d)(?=.*[A-Z])(?=.*[a-z])(?=.*[!@#$%^&*? ]).*$/;
        oInput[3].onblur = function() {
            var val4 = oInput[3].value;
            if (reg3.test(val4)) {
                oSpan[3].innerText = "格式正确";
            } else {
                oSpan[3].innerText = "格式错误";
            }
        }
        var reg4 = /^.*(?=.{6,})(?=.*\d)(?=.*[A-Z])(?=.*[a-z])(?=.*[!@#$%^&*? ]).*$/;
        oInput[4].onblur = function() {
            var val4 = oInput[4].value;
            if (reg4.test(val4)) {
                oSpan[4].innerText = "格式正确";
            } else {
                oSpan[4].innerText = "格式错误";
            }
        }

        var oZc = document.querySelector("#zhc")
        console.log(oZc)
        oZc.onclick = function() {
            $.get("http://jx.xuzhixiang.top/ap/api/reg.php", {
                "username": oInput[0].value,
                "password": oInput[3].value
            }).then((res) => {
                console.log(res);
                console.log(res.msg);
                let a = res.msg
                oSpan[3].innerText = a
                console.log(oSpan[3].value);
            })
        }
    </script>
</body>

</html>